package base.day22.stream;

import java.util.ArrayList;
import java.util.stream.Stream;

public class MyStream7 {
    public static void main(String[] args) {
        ArrayList<String> actor=new ArrayList<>();
        actor.add("周杰伦");
        actor.add("林俊杰");
        actor.add("张三");
        actor.add("王五");
        actor.add("周润发");
        ArrayList<String> actress=new ArrayList<>();
        actress.add("杨1");
        actress.add("杨2");
        actress.add("张3");
        actress.add("杨4");
        actress.add("李5");

        Stream<String> men = actor.stream().filter(s -> s.length() == 3).limit(2);
        Stream<String> women = actress.stream().filter(s -> s.startsWith("杨")).skip(1);
        Stream.concat(men,women).forEach(name->{
            Actor names = new Actor(name);
            System.out.println(names);
                }
        );

    }
}
